package com.xbao.dao;

import com.xbao.model.AskAbsent;
import com.xbao.model.AskAbsentExample;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface AskAbsentMapper {
    @SelectProvider(type=AskAbsentSqlProvider.class, method="countByExample")
    int countByExample(AskAbsentExample example);

    @DeleteProvider(type=AskAbsentSqlProvider.class, method="deleteByExample")
    int deleteByExample(AskAbsentExample example);

    @Delete({
        "delete from ask_absent",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into ask_absent (id, sid, orgid, ",
        "pid, createtime, updatetime, ",
        "status, cid)",
        "values (#{id,jdbcType=BIGINT}, #{sid,jdbcType=BIGINT}, #{orgid,jdbcType=BIGINT}, ",
        "#{pid,jdbcType=BIGINT}, #{createtime,jdbcType=BIGINT}, #{updatetime,jdbcType=BIGINT}, ",
        "#{status,jdbcType=INTEGER}, #{cid,jdbcType=BIGINT})"
    })
    int insert(AskAbsent record);

    @InsertProvider(type=AskAbsentSqlProvider.class, method="insertSelective")
    int insertSelective(AskAbsent record);

    @SelectProvider(type=AskAbsentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sid", property="sid", jdbcType=JdbcType.BIGINT),
        @Result(column="orgid", property="orgid", jdbcType=JdbcType.BIGINT),
        @Result(column="pid", property="pid", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="cid", property="cid", jdbcType=JdbcType.BIGINT)
    })
    List<AskAbsent> selectByExample(AskAbsentExample example);

    @Select({
        "select",
        "id, sid, orgid, pid, createtime, updatetime, status, cid",
        "from ask_absent",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sid", property="sid", jdbcType=JdbcType.BIGINT),
        @Result(column="orgid", property="orgid", jdbcType=JdbcType.BIGINT),
        @Result(column="pid", property="pid", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="cid", property="cid", jdbcType=JdbcType.BIGINT)
    })
    AskAbsent selectByPrimaryKey(Long id);

    @UpdateProvider(type=AskAbsentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") AskAbsent record, @Param("example") AskAbsentExample example);

    @UpdateProvider(type=AskAbsentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") AskAbsent record, @Param("example") AskAbsentExample example);

    @UpdateProvider(type=AskAbsentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(AskAbsent record);

    @Update({
        "update ask_absent",
        "set sid = #{sid,jdbcType=BIGINT},",
          "orgid = #{orgid,jdbcType=BIGINT},",
          "pid = #{pid,jdbcType=BIGINT},",
          "createtime = #{createtime,jdbcType=BIGINT},",
          "updatetime = #{updatetime,jdbcType=BIGINT},",
          "status = #{status,jdbcType=INTEGER},",
          "cid = #{cid,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(AskAbsent record);
}